Open
Conversation
- Add rules.md: senior engineering standards for the code challenge. - Implement sum_to_n in three ways: A) Closed-form n(n+1)/2 — O(1) time/space. B) For-loop accumulation — O(n) time, O(1) space. C) Recursion with base case n<1 — O(n) time, O(n) stack. - Handle edge cases: n<1 returns 0, non-integer via Math.floor. - Add sum_to_n.test.js: normal cases, n=0, negative, non-integer. - All logic pure; exports for Node. Made-with: Cursor
- Replace template with Vite + React app; logic in TypeScript, UI in JSX. - Data: Switcheo prices.json and token-icons repo; dedupe by currency, omit no-price. - Architecture: services (priceService), hooks (useTokensWithPrices, useSwapForm), utils (exchange, validation, tokenIcon, imagePreload), types (Token, PriceRecord). - UI: SwapCard, TokenSelect, TokenIcon; validation, swap direction, rate display. - Preload token images on load; fallback icon on image error; toast on success/error with swap details (amount from/to). English toast messages. Made-with: Cursor
- ANALYSIS.md: document 14 issues (bugs, performance, types, architecture). Fix wrong filter variable (lhsPriority→balancePriority), filter logic, missing blockchain on WalletBalance, useMemo deps, sort return 0, use formattedBalances for rows, stable keys, getPriority outside component, Blockchain union type, logic in hook/utils, error/loading handling. - Refactor: types (wallet.ts), utils (walletBalance.ts), hook (useSortedFormattedBalances), WalletPage UI-only. Aligns with rules.md. Made-with: Cursor
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(problem1): sum 1 to n with 3 implementations and tests
A) Closed-form n(n+1)/2 — O(1) time and space.
B) For-loop accumulation — O(n) time, O(1) space.
C) Recursion with base case n<1 — O(n) time, O(n) stack.
feat(problem2): currency swap form with Vite, React, TypeScript
Forms UI
feat(problem3): WalletPage analysis and refactor